<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let sum = 0
      let count = 0
      for (let i = 1; i <= 300; i++) {
        if (i % 3 === 0 && i % 7 !== 0|| i % 10 === 0)  {
          sum += i
          count++
          console.log(i);
        }
      }
      console.log(count);
      document.write('1-300之间 能被3整除，不能被7整除，或者能被10整数的累计和为'+sum)
      document.write('<br>平均值为'+ sum / count)
    </script>
  </body>
</html>
